package com.seadragon.app.dms.controller;

import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Set;

import com.seadragon.app.dms.model.Address;
import com.seadragon.app.dms.model.CreditCard;
import com.seadragon.app.dms.model.Customer;
import com.seadragon.app.dms.model.Deliveree;
import com.seadragon.app.dms.model.Order;
import com.seadragon.app.dms.model.OrderStatus;
import com.seadragon.app.dms.model.Payment;
import com.seadragon.app.dms.model.Recipient;
import com.seadragon.app.dms.model.ScheduledPickupDate;
import com.seadragon.app.dms.model.Sender;
import com.seadragon.app.dms.model.ShippingPackage;

public class DummyData {
	public static Order getDummyOrder(){
		Order order = new Order();
		Sender sender = new Sender();
		Recipient recipient = new Recipient();
		Address addr = new Address();
		Payment payment = new Payment();
		CreditCard cc = new CreditCard();
		ShippingPackage pkg = new ShippingPackage();
		Set<ShippingPackage> pkgSet = new HashSet<ShippingPackage>();
		Set<Payment> paymentSet = new HashSet<Payment>();
		
		/*==========Sender==========*/
		addr.setAddressLine1("12661 Margna Carta Rd");
		addr.setCity("Herndon");
		addr.setState("VA");
		addr.setZip("20171");
		
		sender.setCompanyName("ABC company");
		sender.setLastName("Zhu");
		sender.setFirstName("Yadong");
		sender.setPhoneNumber("571-572-9527");
		sender.setSource(addr);
		
		/*==========Recipient==========*/
		addr = new Address();
		addr.setAddressLine1("1150 15th NW Street");
		addr.setCity("Wasington");
		addr.setState("DC");
		addr.setZip("20071");
		
		recipient.setCompanyName("DEF company");
		recipient.setLastName("Wang");
		recipient.setFirstName("Hailong");
		recipient.setPhoneNumber("571-572-9528");
		recipient.setDestination(addr);
		 
		/*==========Package Set==========*/
		pkg.setWeight(12);
		pkg.setLength(10);
		pkg.setWidth(5);
		pkg.setHeight(3);
		pkg.setValue(125);
		pkgSet.add(pkg);
		
		pkg = new ShippingPackage();
		pkg.setWeight(23);
		pkg.setLength(20);
		pkg.setWidth(8);
		pkg.setHeight(5);
		pkg.setValue(185);
		pkgSet.add(pkg);
		
		pkg = new ShippingPackage();
		pkg.setWeight(33);
		pkg.setLength(40);
		pkg.setWidth(18);
		pkg.setHeight(9);
		pkg.setValue(285);
		pkgSet.add(pkg);
		
		/*==========Payment Set==========*/
		cc.setAccountNumber("41111");
		cc.setSecurityCode("123");
		cc.setNameAppearedOnCard("Yadong Zhu");
		cc.setExpirationDate(new GregorianCalendar(2015,6,25).getTime());
		payment.setAmount(25.50f);
		payment.setDateCreated(new GregorianCalendar(2013,5,20).getTime());
		payment.setCreditCard(cc);
		paymentSet.add(payment);
		
		cc=new CreditCard();
		cc.setAccountNumber("52222");
		cc.setSecurityCode("456");
		cc.setNameAppearedOnCard("Yadong2");
		cc.setExpirationDate(new GregorianCalendar(2015,8,15).getTime());
		payment=new Payment();
		payment.setAmount(25.50f);
		payment.setDateCreated(new GregorianCalendar(2013,4,30).getTime());
		payment.setCreditCard(cc);
		paymentSet.add(payment);
		
		cc=new CreditCard();
		cc.setAccountNumber("7888");
		cc.setSecurityCode("987");
		cc.setNameAppearedOnCard("Yadong3");
		cc.setExpirationDate(new GregorianCalendar(2018,9,18).getTime());
		payment=new Payment();
		payment.setAmount(25.50f);
		payment.setDateCreated(new GregorianCalendar(2013,7,25).getTime());
		payment.setCreditCard(cc);
		paymentSet.add(payment);
		
		/*==========OrderStatus Set==========*/
		Set<OrderStatus> statusSet = new HashSet<OrderStatus>();
		OrderStatus status= new OrderStatus();
		status.setDateCreated(new GregorianCalendar(2013,6,1).getTime());
		status.setStatus("status1");
		statusSet.add(status);

		status= new OrderStatus();
		status.setDateCreated(new GregorianCalendar(2013,6,2).getTime());
		status.setStatus("status2");
		statusSet.add(status);
		
		status= new OrderStatus();
		status.setDateCreated(new GregorianCalendar(2013,6,3).getTime());
		status.setStatus("status3");
		statusSet.add(status);
		
		/*==========SchedulePickupDateList==========*/
		Set<ScheduledPickupDate> ppdateSet = new HashSet<ScheduledPickupDate>();
		ScheduledPickupDate ppd= new ScheduledPickupDate();
		ppd.setPickupDateScheduled(new GregorianCalendar(2013,6,1,14,30).getTime());
		ppd.setReason("reason1");
		ppd.setValid(false);
		ppdateSet.add(ppd);
		
		ppd= new ScheduledPickupDate();
		ppd.setPickupDateScheduled(new GregorianCalendar(2013,6,1,15,30).getTime());
		ppd.setReason("reason2");
		ppd.setValid(true);
		ppdateSet.add(ppd);
		
		ppd= new ScheduledPickupDate();
		ppd.setPickupDateScheduled(new GregorianCalendar(2013,6,1,16,30).getTime());
		ppd.setReason("reason3");
		ppd.setValid(false);
		ppdateSet.add(ppd);
		
		/*==========Customer==========*/
		Customer customer = new Customer();
		
		/*==========Deliveree==========*/
		Deliveree deliveree = new Deliveree();
		
		
		/*==========Order==========*/
		order.setPackages(pkgSet);
		order.setPayments(paymentSet);
		order.setSender(sender);
		order.setRecipient(recipient);
		order.setPrice(35.68f);
		order.setServiceType(2);
		order.setShippingDate(new GregorianCalendar(2013,5,27).getTime());
		order.setStatusList(statusSet);
		order.setSchedulePickupDateList(ppdateSet);
		order.setCustomer(customer);
		order.setDeliveree(deliveree);
		return order;
	}
	
	public static Set<CreditCard> getDummCreditCardList(){
		Set<CreditCard> list = new HashSet<CreditCard>();
		CreditCard cc = new CreditCard();
		cc.setType("AMEX");
		cc.setAccountNumber("4111123456789012");
		cc.setSecurityCode("123");
		cc.setNameAppearedOnCard("Yadong Zhu");
		cc.setExpirationDate(new GregorianCalendar(2015,6,25).getTime());
		list.add(cc);
		
		cc=new CreditCard();
		cc.setType("VISA");
		cc.setAccountNumber("52222234998877445566");
		cc.setSecurityCode("456");
		cc.setNameAppearedOnCard("Yadong2");
		cc.setExpirationDate(new GregorianCalendar(2015,8,15).getTime());
		list.add(cc);
		
		cc=new CreditCard();
		cc.setType("MSTR");
		cc.setAccountNumber("7888656598988787");
		cc.setSecurityCode("987");
		cc.setNameAppearedOnCard("Yadong3");
		cc.setExpirationDate(new GregorianCalendar(2018,9,18).getTime());	
		list.add(cc);
		return list;
	}
}
